import com.zaxxer.hikari.HikariDataSource;

import java.sql.SQLException;

public class Hello {
    public static void main(String[] args) {
        HikariDataSource ds = new HikariDataSource();
        ds.setJdbcUrl("jdbc:mysql://localhost:3306/jdbc");
        ds.setUsername("root");
        ds.setPassword("abcd1234");
        ds.setDriverClassName("com.mysql.jdbc.Driver");
        try {
            if (ds.getConnection() != null){
                System.out.println("连接成功");
            } else {
                System.out.println("连接失败");
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
